# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataPipelines.V1.Model.GoogleCloudDatapipelinesV1Job do
  @moduledoc """
  Definition of the job information maintained by the pipeline. Fields in this entity are retrieved from the executor API (e.g. Dataflow API).

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time of job creation.
  *   `dataflowJobDetails` (*type:* `GoogleApi.DataPipelines.V1.Model.GoogleCloudDatapipelinesV1DataflowJobDetails.t`, *default:* `nil`) - All the details that are specific to a Dataflow job.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time of job termination. This is absent if the job is still running.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. The internal ID for the job.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. The fully qualified resource name for the job.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The current state of the job.
  *   `status` (*type:* `GoogleApi.DataPipelines.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - Status capturing any error code or message related to job creation or execution.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :dataflowJobDetails =>
            GoogleApi.DataPipelines.V1.Model.GoogleCloudDatapipelinesV1DataflowJobDetails.t()
            | nil,
          :endTime => DateTime.t() | nil,
          :id => String.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :status => GoogleApi.DataPipelines.V1.Model.GoogleRpcStatus.t() | nil
        }

  field(:createTime, as: DateTime)

  field(:dataflowJobDetails,
    as: GoogleApi.DataPipelines.V1.Model.GoogleCloudDatapipelinesV1DataflowJobDetails
  )

  field(:endTime, as: DateTime)
  field(:id)
  field(:name)
  field(:state)
  field(:status, as: GoogleApi.DataPipelines.V1.Model.GoogleRpcStatus)
end

defimpl Poison.Decoder, for: GoogleApi.DataPipelines.V1.Model.GoogleCloudDatapipelinesV1Job do
  def decode(value, options) do
    GoogleApi.DataPipelines.V1.Model.GoogleCloudDatapipelinesV1Job.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataPipelines.V1.Model.GoogleCloudDatapipelinesV1Job do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
